<script>
$(document).ready(function() {
    //prepare the dialog
	
    $( "#thongbao_khautru" ).dialog({
		title: "Thông báo",
        autoOpen: false,
        show: {
            effect: "blind",
            duration: 500
            },
        hide: {
            effect: "blind",
            duration: 500
            },
        modal: true,
		buttons: {
			 "Ok": function() {
				location.reload();
				 $('#thongbao_khautru').dialog('close');
			}
		 }
        });	
		
	$(".close_addservice").click(function(event) {
				$('#dialogModal').dialog('close');
			});
    });
</script>

	<?php echo $this->Form->create('Khautrus',array('controller'=>'khautrus','action'=>'add',$users['User']['id'])); ?>
		<div class="row">
			<label>Nhân viên</label>
			<?php echo $users['User']['name'];?>
		</div>
		<div class="row">
			<label>Tiền bị khấu trừ</label>
			<?php  echo $this->Form->input('money',array('label'=>false,'div'=>false,'id'=>'khautru','type'=>'text'));?>
			<script type="text/javascript">$("#khautru").maskMoney();</script>
		</div>
		<div class="row">
			<label>Lý do</label>
			<?php  echo $this->Form->input('reason',array('label'=>false,'div'=>false));?>
		</div>		
		<div class="btn-dialog">
			
			<?php 
			echo $this->Js->submit('OK', array(  //create 'ajax' save button
				'update' => '#contentWrap','div'=>false  //id of DOM element to update with selector
				));
			if (false != $saved){ //will only be true if saved OK in controller from ajax save above
				echo "<script>
					$('#thongbao_khautru').dialog('open');  //open containing dialog 
				</script>";
				}
			echo $this->Form->end();
			echo $this->Js->writeBuffer();
			?>

			<input type="button" value="Cancel" class="close_addservice">
		</div>

<div id="thongbao_khautru" title="Thông báo">
<p align="center">Đã thêm khấu trừ thành công</p>
</div>
